home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / Anim / Dissolve / Wave < prev    next >
Text File  |  2001-10-01  |  2KB  |  128 lines

  1. /* Dissolve Wave
  2. 101
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.  
  9.     parse ARG Port Opt1 Opt2 Opt3 s0 t0 s1 t1 b
  10.     
  11.     ADDRESS value Port
  12.  
  13.     pp_GetWidth
  14.     w=result
  15.     pp_GetHeight
  16.     h=result
  17.     pp_GetDepth
  18.     D=result
  19.  
  20.     pp_GetCurrentBuffer
  21.     CBf=result
  22.     pp_GetCurrentBrush
  23.     CB=result
  24.  
  25.     pp_FindEmptyBrush
  26.     Brush=result
  27.     if Brush=-1 then DO
  28.         pp_Warn "can't*find*empty|Brush."
  29.         EXIT        
  30.     END
  31.     pp_SetBrush Brush        
  32.  
  33.     pp_FindEmptyBuffer
  34.     Bf=result
  35.     if Bf=-1 then DO
  36.         pp_Warn "can't*find*empty|Buffer."
  37.         EXIT        
  38.     END
  39.     pp_SetBuffer Bf
  40.  
  41.     pp_New w+100 h+100 24
  42.     pp_SpareOnOff
  43.  
  44.     /* Draw your Mask */
  45.         pp_ClearRange 0
  46.         IF Opt3=3 then DO
  47.             pp_setRange 0 0 0 0 0
  48.             pp_setRange 0 19 255 255 255
  49.             pp_Gradient 0 0 0 0
  50.         END
  51.         IF Opt3=2 then DO
  52.             pp_setRange 0 19 0 0 0
  53.             pp_setRange 0 0 255 255 255
  54.             pp_Gradient 0 0 0 0
  55.         END
  56.         IF Opt3=0 then DO
  57.             pp_setRange 0 0 0 0 0
  58.             pp_setRange 0 19 255 255 255
  59.             pp_Gradient 0 1 0 0
  60.         END
  61.         IF Opt3=1 then DO
  62.             pp_setRange 0 19 0 0 0
  63.             pp_setRange 0 0 255 255 255
  64.             pp_Gradient 0 1 0 0
  65.         END
  66.  
  67.         pp_EffectOn
  68.         pp_ComposeReqOff
  69.         pp_BoxF 0 0 w+99 h+99
  70.         pp_Wave 60 30
  71.         pp_Boxf 50 50 w+50 h+50
  72.         pp_pickBrush 50 50 w h 1
  73.         pp_new w h 24
  74.         pp_SpareOnOff
  75.         pp_pent 6
  76.         pp_Plot w/2 h/2
  77.         pp_FreeBrush
  78.         pp_ComposeReqOn
  79.         pp_EffectOff
  80.  
  81.     /*    End    */
  82.     
  83.     pp_SparetoStencil
  84.     pp_SSave "ram:DisSten"
  85.     pp_ClearCurrentBuffer
  86.     pp_SetBuffer CBf
  87.  
  88.     pp_SLoad "ram:DisSten"
  89.     ADDRESS COMMAND
  90.     'delete >nil: ram:DisSten'
  91.     ADDRESS value Port
  92.  
  93.     pp_GotoFrame s1
  94.     pp_PicttoSpare
  95.     pp_GotoFrame s0            
  96.     pp_Pickbrush 0 0 W H 1
  97.     
  98.     step=(s1-s0)
  99.     Step_f=255/Step
  100.  
  101.     DO i=s0 to s1
  102.         IF t1=1 then DO
  103.             pp_GotoFrame (s1+i-s0)
  104.             pp_PicttoSpare
  105.         END
  106.  
  107.         pp_GotoFrame i
  108.  
  109.         IF t0=0 then DO
  110.             pp_plot W/2 H/2
  111.         END
  112.  
  113.         f=Step_f*(i-s0)
  114.         IF Opt1=0 then DO
  115.             pp_Dissolve f 255            
  116.         END
  117.         ELSE DO
  118.             pp_Dissolve f f
  119.         END
  120.         pp_Refresh
  121.     END
  122.  
  123.         pp_Gotoframe s0
  124.         pp_FreeBrush
  125.         pp_SetBrush CB
  126.  
  127.     EXIT
  128.